#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 1e6 + 5;
char s[maxn];
int nex[maxn][26];
int main()
{
  scanf("%s",s+1);
  int l = strlen(s+1);
  for(int i=l-1;i>=0;i--)
  {
      for(int j=0;j<26;j++)
      {
          nex[i][j] = nex[i+1][j];
      }
      nex[i][s[i+1]-'a'] = i+1;
  }
  int t;
  scanf("%d",&t);
  while(t--)
  {
      scanf("%s",s+1);
      l = strlen(s+1);
      int k = 0,flag = 0;
      for(int i=1;i<=l;i++)
      {
          if(nex[k][s[i]-'a']){
              k = nex[k][s[i]-'a'];
          }
          else{
              flag = 1;
              break ;
          }
      }
      if(flag)
          printf("No\n");
      else
          printf("Yes\n");
  }
  return 0;
}